<?php
if ($this->session->userdata('admin') == 1) {
    ?>
    <!DOCTYPE html>
    <!--[if lt IE 7 ]><html lang="en" class="ie6 ielt7 ielt8 ielt9"></html><![endif]--><!--[if IE 7 ]><html lang="en" class="ie7 ielt8 ielt9"></html><![endif]--><!--[if IE 8 ]><html lang="en" class="ie8 ielt9"></html><![endif]--><!--[if IE 9 ]><html lang="en" class="ie9"> </html><![endif]--><!--[if (gt IE 9)|!(IE)]><!--> 
    <html lang="en"><!--<![endif]--> 
        <head>
            <meta charset="utf-8" />
            <title><?php echo $title; ?></title>

            <meta name="viewport" content="width=device-width, initial-scale=1.0" />
            <meta name="description" content="" />
            <meta name="author" content="" />
          <script type="text/javascript" src="<?php echo site_url(); ?>/backend/js/jquery-1.5.2.min.js"></script>
            <!-- Le styles -->
            <link rel="shortcut icon" href="<?php echo site_url(); ?>G4/images/logo.png" />
            <link href="<?php echo site_url(); ?>backend/css/bootstrap.css" rel="stylesheet" />
            <link href="<?php echo site_url(); ?>backend/css/mes-admin.css" rel="stylesheet" />
            <link href="<?php echo site_url(); ?>backend/css/bootstrap-responsive.css" rel="stylesheet" />

            <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
            <!--[if lt IE 9]>
             <script src="../../../html5shim.googlecode.com/svn/trunk/html5.js"></script>
           <![endif]-->

            <!-- Le fav and touch icons -->
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        </head>
        <body>
  <script type="text/javascript"> 
  
  //select checkbox all by Mr Thary
         $(function(){
        $("#select_all").click ( function(){
            $("input[type='checkbox'].child").attr ( "checked" , $(this).attr("checked" ) );
        });
    });
    
    function check(id){
            $("input[type='checkbox'].child").attr ("checked", false);
            $("#check"+id).attr ("checked", true);
    };	
    
//    Height equal
    $(function(){
        $('.column').equalHeight();
    });
    </script>
            <div class="navbar navbar-fixed-top">
                <div class="navbar-inner">
                    <div class="container-fluid">
                        <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                        </a>
                        <div class="nav-collapse">
                            <ul class="nav">

                                <a class="brand" href="#"><?php
    $image_properties = array(
        'src' => site_url() . 'G4/images/logo.png',
        'class' => 'post_images',
        'width' => '50',
        'height' => '30',
        'rel' => 'lightbox',
        'style' => 'margin-left:15px; background: none repeat scroll 0 0 white;
								  border-radius: 5px 5px 5px 5px; padding: 6px; '
    );
    echo img($image_properties);
    ?>
                       <h4 style="float:right; padding-left: 15px;">GROUP DEVELOPER <br/>&nbsp; &nbsp; IN CAMBODIA</h4>
                                </a>

                                <!--<form class="navbar-search pull-left" action="" />
                                  <input type="text" class="search-query span2" placeholder="Search" required="" />
                                </form>--> 
                            </ul>
                            <ul class="nav pull-right">
                               
                               
                                 <li class="divider-vertical"></li>
                                <li><a data-toggle="modal"><i class="icon-white icon-info-sign"></i>Number All Users : <span class="badge badge-warning"><?php echo $this->session->userdata('count_member'); ?></span></a></li>
                                <li class="divider-vertical"></li>
                                <li class="dropdown">
                                    <a target="_blank" href="<?php echo site_url('pages/news'); ?>" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-white icon-eye-open"></i> View site  <b class="caret"></b></a>

                                </li>
                                <li class="divider-vertical"></li>
                                <li><a href="#help"><i class="icon-white icon-question-sign"></i> Help </a></li>


                            </ul>
                        </div><!--/.nav-collapse -->
                    </div>
                </div>
            </div>
            <h5>&nbsp;</h5>
            <div class="container-fluid">
                <div class="row-fluid">
                    <div class="span2">
                        <div class="nav-headers"><h3>Administrator </h3></div>
                        <div style="float: right; margin-right:-1090px; margin-top: -30px; position: relative;"><?php echo "Welcome : <span style='color:white;'>&hearts; ".$this->session->userdata('username')."</span>"; ?></div>
                        <ul class="nav nav-tabs nav-stacked">
                            <li><a href="<?php echo site_url('pages/logout'); ?>"><i class="icon-th-large"></i> Logout </a></li>
                            <li><a href="<?php echo site_url('backend_pages/admin_profiles'); ?>"><i class="icon-user"></i> My Account </a></li>
                        </ul>
                        <div class="nav-headers"><h3>Advertisings </h3></div>
                        <ul class="nav nav-tabs nav-stacked">
                            <li><a href="<?php echo site_url('backend_pages/addItem'); ?>"><i class="icon-plus"></i> Add Advertising </a></li>
                            <li><a href="<?php echo site_url('backend_pages/allItem'); ?>"><i class="icon-user"></i> All Advertising </a></li>
                        </ul>
                        <div class="nav-headers"><h3>Users Products </h3></div>
                        <ul class="nav nav-tabs nav-stacked">

                            <li><a href="<?php echo site_url('backend_pages/addproducts'); ?>"><i class="icon-file"></i> Add Products </a></li>
                            <li><a href="<?php echo site_url('backend_pages/allproducts'); ?>"><i class="icon-file"></i> All Products </a></li>

                        </ul>
                        <div class="nav-headers"><h3>News Management </h3></div>
                        <ul class="nav nav-tabs nav-stacked">

                            <li><a href="<?php echo site_url('backend_pages/add_news_control'); ?>"><i class="icon-file"></i> Add News </a></li>
                            <li><a href="<?php echo site_url('backend_pages/all_news_control'); ?>"><i class="icon-file"></i> All News </a></li>

                        </ul>
                        <div class="nav-headers"><h3>Menu Management </h3></div>
                        <ul class="nav nav-tabs nav-stacked">
                            <li><a href="<?php echo site_url('backend_pages/addmenu'); ?>"><i class="icon-plus"></i> Add Menu </a></li>
                            <li><a href="<?php echo site_url('backend_pages/allmenu'); ?>"><i class="icon-user"></i> All Menu </a></li>
                        </ul>
                        <div class="nav-headers"><h3>Member </h3></div>
                        <ul class="nav nav-tabs nav-stacked">
                            <li><a href="<?php echo site_url('backend_pages/addmember'); ?>"><i class="icon-plus"></i> Add Members </a></li>
                            <li><a href="<?php echo site_url('backend_pages/member'); ?>"><i class="icon-user"></i> All Members </a></li>
                        </ul>

                        
                    </div>
                    <div class="span10">
                        <div class="row-fluid">
                            <div class="span12 box">
                                <div class="box-head">
                                    <div class="nav-headers"><h4><?php echo $title; ?> </h4></div>
                                </div>
                                <div class="box-content">
                                    <?php
                                    $seg1 = $this->uri->segment(1); // controller = directory
                                    $seg2 = $this->uri->segment(2); // method = file
                                    if (!$seg2) {
                                        $this->load->view("pages_admin/backend_pages/member");
                                    } else {
                                        $this->load->view("pages_admin/" . $seg1 . "/" . $seg2);
                                    }
                                    ?>                  
                                </div><!-- content-inner -->
                            </div>
                        </div>
                    </div>  <!-- end row -->

                </div><!--/span-->
            </div><!--/row-->
<!--Alert-->
<?php
/*$action3 = $this->uri->segment(3);
$action4 = $this->uri->segment(4);
if($action3=='success'&& $action4=='del' ){
	echo '<script>alert(" Delete successfull !");</script>';
}
if($action3=='success'&& $action4=='add' ){
	echo '<script>alert(" Add Menu successfull !");</script>';
}
if($action3=='success'&& $action4=='edit' ){
	echo '<script>alert(" Edit Menu successfull !");</script>';
}
if($action3=='success'&& $action4=='cust_add' ){
    echo '<script>alert(" Add Customer successfull !");</script>';
}
if($action3=='success'&& $action4=='cust_del' ){
    echo '<script>alert(" Delete Customer successfull !");</script>';
}
if($action3=='success'&& $action4=='cust_edit' ){
    echo '<script>alert(" Edit Customer successfull !");</script>';
}
	if($action4=='error' ){
    echo '<script>alert(" Please fill all required !");</script>';
}*/
?>
<!---->
            <hr class="alt" />

            <footer>
                <p align="center">Copyright &copy; 2013 KHMER ADVERTISING (Cambodia). All rights reserved.</p>
            </footer>

        </div><!--/.fluid-container-->

        <!-- Le javascript
       ================================================== -->
        <!-- Placed at the end of the document so the pages load faster -->
        <script src="./js/jquery-1.7.2.min.js"></script>
        <script src="./js/bootstrap.min.js"></script>
        <script src="./js/mes-admin.js"></script>
    </body>
    </html>
    <?php
} else {
    redirect(base_url());
}
?>